<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jquery中ajax使用peomise</title>
</head>
<body>

<input type="button" value="get data" id="get">

<script src="../node_modules/jquery/dist/jquery.min.js"></script>

<script>
    $(function () {
        $('#get').on('click', () => {
            $.ajax({
                url: './data.json',
                type: 'get',
                dataType:'json',
                // success:(data) => {
                //     console.log(data)
                // }

            })
                .then((data) => {
                    console.log(data)
                });
        })
    });
</script>
</body>
</html>